pkgname=pmbench
pkgver=0.7
pkgrel=1
pkgdesc="Micro benchmark for system pager performance "
arch=(i386 x86_64)
url=https://bitbucket.org/jisooy/pmbench
license=(GPL)
depends=()
makedepends_debian_11=(uuid-dev libxml2-dev libuuid-devel)
source=('https://bitbucket.org/hying-caritas/pmbench.git')
md5sums=('SKIP')

build()
{
  if [ ! -f "/usr/include/uuid/uuid.h" ];then
        if [ ! -d "/usr/include/uuid" ];then
                mkdir "/usr/include/uuid"
        fi
        cp /usr/include/uuid.h /usr/include/uuid
  fi

  cd "${srcdir}"/pmbench
  if [[ $CARCH == 'x86_64' ]]; then
    march=64 make pmbench
  else
    march=32 make pmbench
  fi
}

package()
{ 
  install -D ${srcdir}/$pkgname/pmbench $pkgdir/usr/local/bin/pmbench
  install -m664 -D ${srcdir}/$pkgname/doc/pmbench.1 ${pkgdir}/usr/local/share/man/man1/pmbench.1
}
